package com.xbongbong.workflow.domain.dao;

import com.xbongbong.workflow.domain.entity.WorkflowTaskEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface WorkflowTaskDao {
    Long insert(WorkflowTaskEntity entity);

    void insertBatch(List<WorkflowTaskEntity> list);

    WorkflowTaskEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid );

    Integer update(WorkflowTaskEntity entity);

    List<WorkflowTaskEntity> findEntities(@Param("param") Map<String, Object> param);

    Integer getEntitiesCount(@Param("param") Map<String, Object> param);

    void updateFlowStatusByTaskId(@Param("corpid") String corpid, @Param("taskId") Long taskId, @Param("flowStatus") Integer flowStatus);

    void deleteByTaskIds(@Param("corpid") String corpid, @Param("taskIds") List<Long> taskIds);
}